/*************************************************************************
	> File Name: P3912.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-14 09:34:15
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int init_prime(vector<bool> &flag, int n) {
    vector<int> prime;
    for (int i = 2; i <= n; i++) {
        if (flag[i] == 0)
            prime.push_back(i);
        for (int j = 0; j < prime.size(); j++) {
            if (i * prime[j] > n) break;
            flag[i * prime[j]] = 1;
            if (i % prime[j] == 0) break;
        }
    }
    return prime.size();
}

int main() {
    int n;
    cin >> n;
    vector<bool> flag(n);
    flag.push_back(0);
    int cnt = init_prime(flag, n);
    cout << cnt << endl;
    return 0;
}
